package com.vive.wicket;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.FeedbackPanel;

import java.util.ArrayList;
import java.util.List;

import static org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onSubmit;

public class JobPage extends WebPage {
    private static List SITES = new ArrayList();
    static {
        SITES.add("http://aa.com");
        SITES.add("http://bb.com");
        SITES.add("http://cc.com");
    }
    private static final long serialVersionUID = 1L;
    private Form<Void> form;
    public JobPage(){
        Label label = new Label("label", "This is Job Page");
        add(label);
        FeedbackPanel feedback2 = new FeedbackPanel("feedback2");
        add(feedback2);

        form = new Form<Void>("formDrop"){
            protected void onSubmit(){
                feedback2.info("Submitted");
            }
        };
        add(form);

        Button button1 = new Button("button1"){
            protected void onSubmit(){
                feedback2.info("Submitted");
            }
        };

        form.add(button1);

        Button button2 = new Button("button2"){

        };
        form.add(button2);

        DropDownChoice siteChoice = new DropDownChoice("sites5", SITES);
//        siteChoice.setRequired(true);
//        siteChoice.setNullValid(true);
        form.add(siteChoice);



    }
}
